/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package application;

/**
 *
 * @author suvam
 */
import java.net.*;
import java.io.*;

public class knock {
    public static void main(String[] args) throws IOException {

        ServerSocket serverSocket = null;
        try {
            serverSocket = new ServerSocket(4444);
        } catch (IOException e) {
            System.err.println("Could not listen on port: 4444.");
            System.exit(1);
        }

        Socket clientSocket = null;
        try {
            while(true)
            {
                clientSocket = serverSocket.accept();
                myThread th=new myThread(clientSocket);
                th.start();
            }
        } catch (IOException e) {
            System.err.println("Accept failed.");
            System.exit(1);
        }

        clientSocket.close();
        serverSocket.close();
    }
}
